package singles

import (
	"github.com/go-resty/resty/v2"
	"showurl/static-file/kplayer/apis/config"
	httpUtils "showurl/static-file/kplayer/apis/utils/http"
)

type RespGetMedia struct {
	MediaPlayList []RespGetMediaItem `json:"media_play_list"`
}
type RespGetMediaItem struct {
	Unique string `json:"unique"`
	Type   string `json:"type"`
	Path   string `json:"path"`
}

func GetMedia() *RespGetMedia {
	resp := &RespGetMedia{}
	httpUtils.ParseResponseJsonBody(func(r *resty.Request) (*resty.Response, error) {
		return r.Get(config.Host + `/v1.1/media`)
	}, resp)
	return resp
}
